package org.javacraft.qa.model;

import com.google.appengine.api.datastore.Key;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @author jan
 */
@Entity
public class DailyTrafficJamState implements Serializable {

  private static final long serialVersionUID = 1L;

  @Id
  @GeneratedValue( strategy = GenerationType.IDENTITY )
  private Key id;

  @Temporal(TemporalType.DATE)
  private Date timeQueue;

  private int[] lengths = new int[288];

  /**
   * Get the value of length
   *
   * @return the value of length
   */
  public int[] getLengths() {
    return lengths;
  }

  /**
   * Set the value of length
   *
   * @param length new value of length
   */
  public void setLengths( int[] length ) {
    this.lengths = length;
  }

  /**
   * Get the value of length at specified index
   *
   * @param index
   * @return the value of length at specified index
   */
  public int getLength( int index ) {
    return this.lengths[index];
  }

  /**
   * Set the value of length at specified index.
   *
   * @param index
   * @param newLength new value of length at specified index
   */
  public void setLength( int index, int newLength ) {
    this.lengths[index] = newLength;
  }

  /**
   * Get the value of date
   *
   * @return the value of date
   */
  public Date getDate() {
    return timeQueue;
  }

  /**
   * Set the value of date
   *
   * @param date new value of date
   */
  public void setDate( Date day ) {
    this.timeQueue = day;
  }

  @Override
  public String toString() {
    return "DailyTrafficJamState{" + "timeQueue=" + timeQueue + "lengths=" + lengths + '}';
  }

  
}
